home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / StyledEditorKit$AlignmentAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.2 KB  |  36 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.util.EventObject;
  5. import javax.swing.JEditorPane;
  6.  
  7. public class StyledEditorKit$AlignmentAction extends StyledEditorKit.StyledTextAction {
  8.    // $FF: renamed from: a int
  9.    private int field_0;
  10.  
  11.    public StyledEditorKit$AlignmentAction(String var1, int var2) {
  12.       super(var1);
  13.       this.field_0 = var2;
  14.    }
  15.  
  16.    public void actionPerformed(ActionEvent var1) {
  17.       JEditorPane var2 = ((StyledEditorKit.StyledTextAction)this).getEditor(var1);
  18.       if (var2 != null) {
  19.          int var3 = this.field_0;
  20.          if (var1 != null && ((EventObject)var1).getSource() == var2) {
  21.             String var4 = var1.getActionCommand();
  22.  
  23.             try {
  24.                var3 = Integer.parseInt(var4, 10);
  25.             } catch (NumberFormatException var5) {
  26.             }
  27.          }
  28.  
  29.          SimpleAttributeSet var6 = new SimpleAttributeSet();
  30.          StyleConstants.setAlignment(var6, var3);
  31.          ((StyledEditorKit.StyledTextAction)this).setParagraphAttributes(var2, var6, false);
  32.       }
  33.  
  34.    }
  35. }
  36.